import { http } from '@renderer/utils/axios'
import type { User, UserListType } from './type'
export const addUser = (data: User) => {
  return http.post({ url: 'user/addUser', data })
}

export const deleteUser = (data: number) => {
  return http.post({ url: 'user/deleteUser', data })
}

export const updateUser = (data: User & { id: number }) => {
  return http.post({ url: 'user/updateUser', data })
}

export const getUserPage = async (data: any) => {
  return http.post<User[]>({ url: 'user/getUserPage', data })
}
export const getUserList = async () => {
  return http.post<PageType<UserListType[]>>({ url: 'api/user/getUserList' })
}
